package com.xiao.sulingwallet.config;

import com.alipay.easysdk.factory.Factory;
import com.alipay.easysdk.kernel.Config;
import org.springframework.stereotype.Component;

/**
 * @author: 1322127758@qq.com
 * @date: 2022/3/14 18:00
 * @作用: 支付宝沙箱支付相关配置
 */
@Component
public class AlipayConfig {
    //1.设置参数 (全局只需要配置一次)
    static{
        Factory.setOptions(getOptions());
    }

    private static Config getOptions(){
        Config config = new Config();

        config.protocol = "https";

        //密匙的格式
        config.signType = "RSA2";
        //你的APPID
        config.appId = "2021000119629392";
        //你的私钥
        config.merchantPrivateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCA8HdBDdi+HrFauk1Btm+SApXS630V1XJ8iSZdEJZnNgMFCewzedIS/102yNYW8Xbh1mK1Eh11Pv79XiMIS7bU1/uXkQf5n78JpWoxdFYsdv9gOEA6uMVR7RiSdhQrS6uO2ALlEmYGE9YJNsPl6vjlnUf+YL2LmLxIEflAD1U+/mGzh7WZHJZQ3TrCZoTM1ahP/rbN9hNyEJBggkI5DcdyTtkJ7bakUE323cPmbdCPl/ADIMWMse1l7990lkDUCsECbjw+Sqpk9TJ5PbZg5xLiqJkvvmixgZ9D3PdkQQkJ7fXbfgdc539IdnQ9OJInfZ1TGxWbMcX5Ka2l+365Is5FAgMBAAECggEAaPthHaaYgrOa07Q8kvRngwp30nPKNKzFuoAwrDWFQCPJ8aBSoNbfJHim/KQpLCUOFnLni2ZkdcIE+2ZaP7bl9gak4pNDWwumD8SO4hVG1I1PAJjMMwOeJUZWa2mYomfKF1Pph3mjd+9OpdHhTqIyZUHaDFPYAIErS8LWnkHdtptgLnwg8x3CwFaGEdT1ipPrI3N1Vv/344wclDLkJ8CFTEyJ12MjHUwUSZ2jtJbCTrUlrO7wJFY8AR5lcvhYAbxTpZ7i/aBULOv8x5uBAnu6BFcmgpN15xu1GasAxW0hLcPqgZhlIgK7SeE5gnUrnnPGNMfzB84FFZnasBfznxebQQKBgQC4VMr38FhwD8tKnoH4pkRS9lyEqxRXKtVYOsUyU2s7/YqokqyPkH/Zcic/0m06RKDCNBVoloHD8vo5pdm2xanPp6thblhIm0HmN3zaxageNd1vcvG30DVKPWX95Eqlixu2SiISgyw1QMAZvPGJXVuxWao9LX/xa8UV0mTWXU3FIwKBgQCzEkzm4kRQLNZXHT0EqyqZU1iKDg3NTW4I8AIH3NyXN0WA0QDaUE5p0juiKHKLhR12QwJRvR+oEglYCp8Cma4jn8H4E0A1qcRK257jStC+LITza51dd1wCexCtlJ8UOaJ2gLAhtMWC7T8MuVFUYeSkxnrdHLTDHCy1j/LoRHFZdwKBgQCUANk7fMq1p6jWEDFRgcbISjF9AJSDbMwCXKXrQ5mNgIUt1x8g4qgU4xhqoT28lE/zvrgV0wr8V4LceLM3krxHFFyCDYRrP+YIwDLKwfu7zgovKz60FUREiMn0srHQ+8HTevCippn/ZC8aO2BAqCowW0tadccOBDcpz1XR3PbNuwKBgCU5HaE00Yx09Y0gN8nbprw+df4kk7vkZ4YWFeX6hCQuyhTP3USEQvh+SgUYMU9NOWWW4kmJbaYrMaQKeSk6NteS4uglYEiHZJVG9805hRCzAmPzL7/5Crg9Sqc6aKL0pA/MClDHWfMwS9XiQ8StoLCbzXhe+jhAiA6pwI2FhKZbAoGAPDJ//oC1xJ8G3Kcs+BDvhOwi7R5MosyUZtit/NVNSo6WZtwDrdnNMsgr/uxho32eBZhfkr1azBIoKHsRBO9aA05fcekngdiULsnMddrZbnyEAvfVqhZ3xcC2OSuyCRZR8nkveeRx3siO/mbPIYzOwWexuPmfqytEZuerQJPheKI=";
        // 沙箱环境为 openapi.alipaydev.com
        config.gatewayHost = "openapi.alipaydev.com";
        //你的支付宝公钥
        config.alipayPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArZj1jqvgukDlMCamoyTj575ixM37kAgFFj2qfzKlfjJ5szEYtY9sl69oe8tazDEJLEJR35cetnzrcwmoJ5ivskitpfUdNpCe6dzte83ymTOev1vpXOODBDlhkeIk4UL4al5gzt4Eukkdqh2iU1Ggc8EN8vEuCTeAfFqY9Dw4K1Mo5Yt3+iE6aR5yZ16oBRNSesEhGJOBwbqCgez9nFzc8t7yrnDWyu/+sF89Ieq/RwGi5rue71NOqpXKNeSdUetSoP0FTNUY3AFxEgJwjNRd+dUIGLyNyrEeIhh9SDFbL6fKjsz/TE3McPItufVr7uRbjeQgfAB9IruZ/pDdD8c+iwIDAQAB";
        //可设置异步通知接收服务地址（可选）（该地址需要外网能够访问）
        config.notifyUrl = "http://q1322127758.nat300.top/api/wallet/sulingwallet/alipay/pay/asysuccess";

        return config;
    }
}
